//package com.wuchao.util;
//
//import javax.servlet.*;
//import javax.servlet.annotation.WebFilter;
//import javax.servlet.annotation.WebInitParam;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//
///**
// * @Author wuchao66
// * @Date 2023/5/26 21:56
// * @PackageName:${PACKAGE_NAME}
// * @ClassName: ${NAME}
// * @Description: TODO
// * @Param
// * @Version 1.0
// */
//@WebFilter(filterName = "Filter163",urlPatterns = "/*",initParams = {@WebInitParam(name = "encode",value = "utf-8")})
//public class Filter163 implements Filter {
//    private String encode;
//    public void destroy() {
//        if(this.encode!=null){
//            this.encode=null;
//        }
//    }
//
//    public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws ServletException, IOException {
//        //String encode = req.getCharacterEncoding();
//       // return;
//        String encode =( (HttpServletResponse)resp).getCharacterEncoding();
//        System.out.println(encode);
//        if(encode==null||!encode.equals(this.encode)){
//            resp.setCharacterEncoding(this.encode);
//        }
//        chain.doFilter(req, resp);
//    }
//
//    public void init(FilterConfig config) throws ServletException {
//        String encode = config.getInitParameter("encode");
//        this.encode=encode;
//        System.out.println("初始化"+ this.encode);
//    }
//
//}
